
****************
*** Fig. A.3 ***
****************

* load frame
frame change italian_data


* tercile n. associazioni, dummy unemployment change 

reg mainstream i.worse_econ##i.tercile_associations##i.declining_emp i.education age i.male i.election_year i.provincen, vce(cluster province)

margins declining_emp, dydx(worse_econ) at(tercile_associations=(1(1)3))
mplotoffset,  offset(0.1) recast(scatter) ///
		title("") ///
		ytitle("Mainstream vote", size(large)) ///
		xtitle("Number of associations", size(large)) ///		
		yline(0, lw(thin) lstyle(foreground) ) ///
		ylabel(, grid glcolor(black%70) glw(thin) labs(medl)) ///
		xlabel(1 "Low association density" 2 "Mid association density" 3 "High association density", nogrid) ///
		aspect(1) ///
		plot1opts(msymbol(D) msize(medium) mcolor(red) lcolor(red) lwidth(medthick)) ci1opts(lcolor(red)) ///
        plot2opts(msymbol(O) msize(medium) mcolor(blue) lp(solid)  mlcolor(blue) lcolor(blue) lwidth(medthick)) ci2opts(lcolor(blue)) ///
		legend( ///
			region(lwidth(none)) ///
			col(3) ///
			position(6) ///
			order(3 "Declining unemployment" 4 "Increasing unemployment"))
graph export "$folder/replication/figures/figA3a.pdf", replace

* tercile n. of sports clubs, dummy unemployment change 

reg mainstream i.worse_econ##i.tercile_coni_assoc_1999##i.declining_emp i.education age i.male i.election_year i.regionen, vce(cluster regionen)

margins declining_emp, dydx(worse_econ) at(tercile_coni_assoc_1999=(1(1)3))
mplotoffset,  offset(0.05) recast(scatter) ///
		title("") ///
		ytitle("Mainstream vote", size(large)) ///
		xtitle("Number of sports clubs", size(large)) ///		
		yline(0, lw(thin) lstyle(foreground) ) ///
		ylabel(, grid glcolor(black%70) glw(thin) labs(medl)) ///
		xlabel(1 "Low association density" 2 "Mid association density" 3 "High association density", nogrid) ///
		aspect(1) ///
		plot1opts(msymbol(D) msize(medium) mcolor(red) lcolor(red) lwidth(medthick)) ci1opts(lcolor(red)) ///
        plot2opts(msymbol(O) msize(medium) mcolor(blue) lp(solid)  mlcolor(blue) lcolor(blue) lwidth(medthick)) ci2opts(lcolor(blue)) ///
		legend( ///
			region(lwidth(none)) ///
			col(3) ///
			position(6) ///
			order(3 "Declining unemployment" 4 "Increasing unemployment"))
graph export "$folder/replication/figures/figA3b.pdf", replace
	
* Tercile unemployment, tercile associations
reg mainstream i.worse_econ##i.tercile_associations##i.unemp_tercile i.education age i.male i.election_year i.regionen, vce(cluster province)

margins unemp_tercile, dydx(worse_econ) at(tercile_associations=(1(1)3))
mplotoffset,  offset(0.05) recast(scatter) ///
		title("") ///
		ytitle("Mainstream vote", size(large)) ///
		xtitle("Number of associations", size(large)) ///		
		yline(0, lw(thin) lstyle(foreground) ) ///
		ylabel(, grid glcolor(black%70) glw(thin) labs(medl)) ///
		xlabel(1 "Low association density" 2 "Mid association density" 3 "High association density", nogrid) ///
		aspect(1) ///
		plot1opts(msymbol(D) msize(medium) mcolor(red) lcolor(red) lwidth(medthick)) ci1opts(lcolor(red)) ///
        plot3opts(msymbol(O) msize(medium) mcolor(blue) lp(solid)  mlcolor(blue) lcolor(blue) lwidth(medthick)) ci3opts(lcolor(blue)) ///
        plot2opts(msymbol(T) msize(medium) mcolor(orange) lp(solid)  mlcolor(orange) lcolor(orange) lwidth(medthick)) ci2opts(lcolor(orange)) ///
		legend( ///
			region(lwidth(none)) ///
			col(3) ///
			position(6) ///
			order(4 "Low unemployment change" 5 "Mid unemployment change" 6 "High unemployment change"))
graph export "$folder/replication/figures/figA3c.pdf", replace

	

* tercile n. of sports clubs, tercile unemployment change 
	
reg mainstream i.worse_econ##i.tercile_coni_assoc_1999##i.unemp_tercile i.education age i.male i.election_year i.regionen, vce(cluster regionen)

margins unemp_tercile, dydx(worse_econ) at(tercile_coni_assoc_1999=(1(1)3))
mplotoffset,  offset(0.05) recast(scatter) ///
		title("") ///
		ytitle("Mainstream vote", size(large)) ///
		xtitle("Number of sports clubs", size(large)) ///		
		yline(0, lw(thin) lstyle(foreground) ) ///
		ylabel(, grid glcolor(black%70) glw(thin) labs(medl)) ///
		xlabel(1 "Low clubs density" 2 "Mid clubs density" 3 "High clubs density", nogrid) ///
		aspect(1) ///
		plot1opts(msymbol(D) msize(medium) mcolor(red) lcolor(red) lwidth(medthick)) ci1opts(lcolor(red)) ///
        plot3opts(msymbol(O) msize(medium) mcolor(blue) lp(solid)  mlcolor(blue) lcolor(blue) lwidth(medthick)) ci3opts(lcolor(blue)) ///
        plot2opts(msymbol(T) msize(medium) mcolor(orange) lp(solid)  mlcolor(orange) lcolor(orange) lwidth(medthick)) ci2opts(lcolor(orange)) ///
		legend( ///
			region(lwidth(none)) ///
			col(3) ///
			position(6) ///
			order(4 "Low unemployment change" 5 "Mid unemployment change" 6 "High unemployment change"))
graph export "$folder/replication/figures/figA3d.pdf", replace
	
